<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <input type="hidden" id="phone" name="phone" th:value="${phone}"/>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>

</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "system/merchant";
    var datas = [[${@dict.getType('sys_merchant_level')}]];//商户等级
    var datas1 = [[${@dict.getType('sys_freeze_status')}]];//商户实名认证状态
    $(function () {
        var options = {
            url: prefix + "/superiorRelation",
            modalName: "商户",
            queryParams: queryParams,
            search: false,
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'merchantNo',
                    title: '商户编号',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return '<a href="#" onclick="detail(\'' + row.id + '\')">' + value + '</a>';
                    }
                },
                {
                    field: 'merchantCnName',
                    title: '商户名称',
                    sortable: true
                },
                {
                    field: 'parentPhone',
                    title: '上级推广人手机',
                    sortable: true
                },
                {
                    field: 'level',
                    title: '商户等级',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'phone',
                    title: '手机号',
                    sortable: true
                },
                {
                    field: 'realNameStatus',
                    title: '实名状态',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas1, value);
                    }
                },
                {
                    field: 'createTime',
                    title: '创建时间',
                    align: 'center',
                },
               ]
        };
        $.table.init(options);
    });

    function queryParams(params) {
        return {
            "phone": $("#phone").val(),
            pageSize: params.limit,
            pageNum: params.offset / params.limit + 1,
            searchValue: params.search,
            orderByColumn: params.sort,
            isAsc: params.order
        };
    }
















</script>
</body>
</html>